package com.gtq.uhome.service.serviceImpl;

import com.gtq.uhome.mapper.BasicSettingsMapper;
import com.gtq.uhome.service.BasicSettingsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BasicSettingsServiceImpl implements BasicSettingsService {

    @Resource
    BasicSettingsMapper basicSettingsMapper;//协议mapper


    /**
     * 保存客服电话和用户协议的方法
     *
     * @return
     */
    @Override
    public Boolean basicSettings(String phoneNumber, String userAgreement) {
        //修改总站点的电话
        int i = basicSettingsMapper.updateSitePhoneNumber(phoneNumber);
        //以前协议处于失效状态
        int i2 = basicSettingsMapper.setStatus();
        //增加用户协议
        int i1 = basicSettingsMapper.insertAgreement(userAgreement);
        if (i + i1 == 0 && i2 == 0) {
            return false;
        } else {
            return true;
        }
    }

    @Override
    /**
     * 设置派送员接单时间
     * @param setTime 设置时间
     * @return true设置成功 false设置失败
     */
    public Boolean setDispatchTime(String setTime) {

            return false;

    }
}
